<template>
    <div>
      <h3>登录页面</h3>
      <van-field label="账号" v-model="form.username"/>
      <van-field label="密码" v-model="form.password"/>
      <van-button @click="login">登录</van-button>
    </div>
</template>
    
<script>
import maxios from "@/http/axios";
export default {
   
      data(){
      return{
        form:{}
       }
      },
      methods:{
        login(){
          maxios('/zlogin','post',this.form).then(res=>{
            if(res.code==200){
              alert(res.mes)
              localStorage.setItem('userid',res.userid)
              this.$router.push('/userinfo')
            }else {
              alert(res.mes)
            }
          })
        }
      }
    }
</script>
    
<style scoped>
    
</style>